package com.abyss.mr.sort;


import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.Mapper;

import java.awt.image.BandCombineOp;
import java.io.IOException;

public class SortMapper extends Mapper<LongWritable, Text, IntWritable, NullWritable> {
    IntWritable num = new IntWritable();

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        final String[] fields = value.toString().split("\t");
        for (String field : fields) {
            num.set(Integer.parseInt(field.trim()));
            context.write(num, NullWritable.get());
        }

    }
}
